<?
//Überprüfen ob der Abruf über die Hauptseite erfolgt
if(!defined('InStern')) exit;
?>
<center>
<?
if($portal) {
    include("conf/build.conf.php");
    include("conf/ress.conf.php");
    include("funk/game/calcRess.funk.php");
    include("funk/game/calcKosten.funk.php");  
    if(!isset($_REQUEST[forsch])) $_REQUEST[forsch]=1;  
} //ende workaround portal
if(isset($_GET[ress])){
	$ress=$_GET[ress];
}else{ 
	$ress=1;
}
echo "<b>Ressource wählen:</b>
<select onChange=\"location.href='$_SERVER[PHP_SELF]?open=static&id=$_REQUEST[id]&ress='+this.value+'&forsch='+document.getElementById('forsch').value;\" id=\"resstype\">";
foreach($config_ress AS $key=>$value)
{
  echo "<option value=\"$key\"";
  if($_REQUEST[ress]==$key) echo "selected=\"selected\"";
  echo ">$value[name]</option>";
}
if(!isset($_REQUEST[ress])) $ress=1;
else $ress=$_REQUEST[ress];
if(!isset($_REQUEST[forsch])) $forsch=$spieler["Forsch_Ress$ress"];
else $forsch=$_REQUEST[forsch];

echo "</select>
Forschung:<input type=\"text\" value=\"$forsch\" size=\"2\" id=\"forsch\" onChange=\"location.href='$_SERVER[PHP_SELF]?open=static&id=$_REQUEST[id]&forsch='+this.value+'&ress='+document.getElementById('resstype').value;\" />";
echo "<table cellspacing=\"0\" class=\"tabelle\" style=\"margin-top:10px;\" width=\"80%\">
<tr>
 <th>Level</th>
 <th>Minute</th>
 <th>HalbeStunde</th>
 <th>Stunde</th>
 <th>Tag</th>
</tr>
";
for($i=0;$i<=50;$i++)
{
  echo "
  <tr>
   <td align=\"center\">$i</td>
   <td align=\"center\">".round(calcRess(0,$ress,10000000,1000000000, $i, $forsch,60),2)."</td>
   <td align=\"center\">".round(calcRess(0,$ress,10000000,1000000000, $i, $forsch,1800),2)."</td>
   <td align=\"center\">".round(calcRess(0,$ress,10000000,1000000000, $i, $forsch,3600),2)."</td>
   <td align=\"center\">".round(calcRess(0,$ress,10000000,1000000000, $i, $forsch,24*3600),2)."</td>   
  </tr>";
}
echo "
</table>";
?>
</center>